#version 450 compatibility







//#extension GL_KHR_vulkan_glsl : enable
layout(std140, binding = 4) uniform u_TranformMatB {
    vec2 m_CutSize;
    vec2 m_TextureSize;
    
    vec4 m_WidgetSize;
    uvec2 m_Deepin;
};
layout(std140, binding = 5) uniform u_TranformMatC {
    vec2 m_MaskSize;
};



layout(location = 0) in vec4 vPosition;
layout(location = 1) in vec2 vTCoord;

out vec2 TCoord;
out vec2 MaskSize;
out vec4 vPosPos;
out vec2 rt_wh;
//out vec2 MaskTCoord;
//out vec2 Offset;

out float ParentGlobalID;
out float GlobalID;




uniform float FXAA_SUBPIX_SHIFT = 1.0/4.0;
//uniform float rt_w; // GeeXLab built-in
//uniform float rt_h; // GeeXLab built-in



void main(){
    TCoord = vTCoord * (m_CutSize / m_TextureSize);
    //Offset = m_WidgetSize.xy;
    MaskSize = m_WidgetSize.wz;
    //MaskTCoord = m_CutSize * vTCoord / m_CutSize;
    ParentGlobalID = m_Deepin.x;
    GlobalID = m_Deepin.y;
    
    vec4 vert = vPosition;
    vert.xy *= m_CutSize;
    gl_Position = gl_ModelViewProjectionMatrix * (vert);
    //gl_Position = vPosition;



    rt_wh = m_TextureSize;
    vec2 rcpFrame = vec2(1.0/rt_wh.x, 1.0/rt_wh.y);
    vPosPos.xy = TCoord.xy;
    vPosPos.zw = TCoord.xy - (rcpFrame * (0.5 + FXAA_SUBPIX_SHIFT));

    
}







